#include <iostream>
using namespace std;


//水果
class abstractFruit
{
public:
	virtual void show() = 0;
};
class Chinese_Apple :public abstractFood
{
public:
	void show()
	{
		cout << "Chinese_Apple" << endl;
	}
};
class American_Orange :public abstractFood
{
public:
	void show()
	{
		cout << "American_Orange" << endl;
	}
};
//肉类
class abstractMeat
{
public:
	virtual void show() = 0;
};
class Chinese_Pork :public abstractMeat
{
public:
	void show()
	{
		cout << "Chinese_Pork" << endl;
	}
};
class American_Beef :public abstractMeat
{
public:
	void show()
	{
		cout << "American_Beef" << endl;
	}
};
//工厂

class foodFactory
{
public:
	virtual abstractFruitt* getFruit(string fruit) = 0;
	virtual abstractMeat* getMeat(string meat) = 0;
};
class ChineseFactory :public foodFactory
{
public:
	virtual abstractFruitt* getFruit()
	{
		return new Chinese_Apple();
	}
	virtual abstractMeat* getMeat()
	{
		return new Chinese_Pork();
	}
};
class AmericanFactory :public foodFactory
{
public:
	virtual abstractFruitt* getFruit()
	{
		return new American_Orange();
	}
	virtual abstractMeat* getMeat()
	{
		return new American_Beef();
	}
};

int main()
{
	abstractFruitt* fruit;
	abstractMeat* meat;
	
	foodFactory* Chinese_foodFactory;
	Chinese_foodFactory = new ChineseFactory();
	
	fruit = Chinese_foodFactory->getFruit();
	fruit->show();
	meat = Chinese_foodFactory->getMeat();
	meat->show();
	
	foodFactory* American_foodFactory;
	American_foodFactory = new ChineseFactory();
	
	fruit = American_foodFactory->getFruit();
	fruit->show();
	meat = American_foodFactory->getMeat();
	meat->show();
}